package com.hiyee.api.controller.user;

import com.hiyee.pojo.bo.UpdateUserInfoBO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.validation.BindingResult;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@Api(value = "用户相关接口", tags = {"用户相关接口"})
@RequestMapping("user")
public interface UserControllerApi {

    /**
     * Api 只定义接口，具体实现由相应的服务层实现
     * 方便微服务的统一调度和管理
     *
     * 本工程的目标就是定义规范、解耦
     *
     * swagger2 基于接口自动文档生成
     *
     * 提高项目可扩展性
     *
     * @return
     */
    @ApiOperation(value = "获取用户基本信息", notes = "获取用户基本信息", httpMethod = "GET")
    @GetMapping("/getUserInfo")
    public Object getUserInfo(@RequestParam String userId);

    @ApiOperation(value = "获取用户账户信息", notes = "获取用户账户信息", httpMethod = "GET")
    @GetMapping("/getAccountInfo")
    public Object getAccountInfo(@RequestParam String userId);

    @ApiOperation(value = "更新用户信息", notes = "更新用户信息", httpMethod = "POST")
    @PostMapping("/updateUserInfo")
    public Object updateUserInfo(@RequestBody @Valid UpdateUserInfoBO updateUserInfoBO, BindingResult bindingResult);
}
